package com.sigmazero13.MKDummy;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import android.app.Application;

import com.sigmazero13.MKDummy.models.ReferenceCard;
import com.sigmazero13.MKDummy.utils.ReferenceCardParser;

public class MKDummyPlayerApp extends Application {

	List<ReferenceCard> refs;
	
	@Override
	public void onCreate() {
		super.onCreate();
		
		readCards();
	}
	
	
	private void readCards() {
		try {
			InputStream cardFile = this.getAssets().open("ref_cards.xml");
			ReferenceCardParser parser = new ReferenceCardParser(cardFile);
			refs = parser.parse();
		} catch (IOException e) {
			e.printStackTrace();
			refs = new ArrayList<ReferenceCard>();
		}
	}
	
	
	public List<ReferenceCard> getReferenceCards() {
		return refs;
	}
}
